home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Sample.bin / EmblazeClass.java < prev    next >
Text File  |  1998-10-28  |  3KB  |  145 lines

  1. /*
  2.     A basic extension of the java.awt.Frame class
  3.  */
  4.  
  5. import java.awt.*;
  6.  
  7. import geo.emblaze.*;
  8. import geo.emblaze.Emblaze20;
  9. public class EmblazeClass extends Frame
  10. {
  11.     public EmblazeClass()
  12.     {
  13.         // This code is automatically generated by Visual Cafe when you add
  14.         // components to the visual environment. It instantiates and initializes
  15.         // the components. To modify the code, only use code syntax that matches
  16.         // what Visual Cafe can generate, or Visual Cafe may be unable to back
  17.         // parse your Java file into its visual environment.
  18.         //{{INIT_CONTROLS
  19.         setLayout(null);
  20.         setBackground(java.awt.Color.black);
  21.         setSize(600,458);
  22.         setVisible(false);
  23.         try {
  24.             emblaze201.setFileURL(symantec.itools.net.RelativeURL.getURL("blaze/symantec.blz"));
  25.         }
  26.         catch (java.net.MalformedURLException error) { }
  27.         add(emblaze201);
  28.         emblaze201.setBounds(27,23,543,339);
  29.         button1.setActionCommand("button");
  30.         button1.setLabel("Close");
  31.         add(button1);
  32.         button1.setBounds(136,385,60,40);
  33.         button2.setActionCommand("button");
  34.         button2.setLabel("Start");
  35.         add(button2);
  36.         button2.setBounds(270,385,60,40);
  37.         button3.setActionCommand("button");
  38.         button3.setLabel("Pause");
  39.         add(button3);
  40.         button3.setBounds(404,385,60,40);
  41.         setTitle("Untitled");
  42.         //}}
  43.  
  44.         //{{INIT_MENUS
  45.         //}}
  46.  
  47.         //{{REGISTER_LISTENERS
  48.         SymWindow aSymWindow = new SymWindow();
  49.         this.addWindowListener(aSymWindow);
  50.         SymAction lSymAction = new SymAction();
  51.         button1.addActionListener(lSymAction);
  52.         button2.addActionListener(lSymAction);
  53.         button3.addActionListener(lSymAction);
  54.         //}}
  55.     }
  56.  
  57.     public EmblazeClass(String title)
  58.     {
  59.         this();
  60.         setTitle(title);
  61.     }
  62.  
  63.  
  64.  
  65.  
  66.  
  67.     // Used for addNotify check.
  68.     boolean fComponentsAdjusted = false;
  69.  
  70.     //{{DECLARE_CONTROLS
  71.     geo.emblaze.Emblaze20 emblaze201 = new geo.emblaze.Emblaze20();
  72.     java.awt.Button button1 = new java.awt.Button();
  73.     java.awt.Button button2 = new java.awt.Button();
  74.     java.awt.Button button3 = new java.awt.Button();
  75.     //}}
  76.  
  77.     //{{DECLARE_MENUS
  78.     //}}
  79.  
  80.     class SymWindow extends java.awt.event.WindowAdapter
  81.     {
  82.         public void windowClosing(java.awt.event.WindowEvent event)
  83.         {
  84.             Object object = event.getSource();
  85.             if (object == EmblazeClass.this)
  86.                 Frame1_WindowClosing(event);
  87.         }
  88.     }
  89.     
  90.     void Frame1_WindowClosing(java.awt.event.WindowEvent event)
  91.     {
  92. //        hide();         // hide the Frame
  93.         dispose();
  94.     }
  95.  
  96.     class SymAction implements java.awt.event.ActionListener
  97.     {
  98.         public void actionPerformed(java.awt.event.ActionEvent event)
  99.         {
  100.             Object object = event.getSource();
  101.             if (object == button1)
  102.                 button1_Action(event);
  103.             else if (object == button2)
  104.                 button2_Action(event);
  105.             else if (object == button3)
  106.                 button3_Action(event);
  107.         }
  108.     }
  109.  
  110.     void button1_Action(java.awt.event.ActionEvent event)
  111.     {
  112.         // to do: code goes here.
  113.              
  114.         //{{CONNECTION
  115.         // Hide the Frame
  116.         setVisible(false);
  117.         dispose();
  118.         //}}
  119.     }
  120.  
  121.     void button2_Action(java.awt.event.ActionEvent event)
  122.     {
  123.         // to do: code goes here.
  124.              
  125.         //{{CONNECTION
  126.         // Start the animation
  127.         {
  128.             emblaze201.start();
  129.         }
  130.         //}}
  131.     }
  132.  
  133.     void button3_Action(java.awt.event.ActionEvent event)
  134.     {
  135.         // to do: code goes here.
  136.              
  137.         //{{CONNECTION
  138.         // Pause the animation
  139.         {
  140.             emblaze201.freeze();
  141.         }
  142.         //}}
  143.     }
  144. }
  145.